﻿#ifndef _OI_PLSCANNERCORE_MESSAGEOUTPUT_HPP_
#define _OI_PLSCANNERCORE_MESSAGEOUTPUT_HPP_

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API MessageOutput : public QWidget
        {
            Q_OBJECT

        public:
            enum MsgStyle
            {
                normal,
                alarm,
            };

        public:
            MessageOutput(QWidget *parent = 0);
            ~MessageOutput();

            void append(const QString& text, MsgStyle style = normal);

            void check();

            void flush();

            void clear();

            void clear(const QString& text);

       signals:
            void alarmChanged(bool);

        public slots:
            void onContextMenuRequested(const QPoint&);

        private:
            OI_DISABLE_COPY(MessageOutput);
            OI_DECLARE_IMPL(MessageOutput);
        };
    }
}

#endif
